<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// use app\middleware\Auth;
use think\api\Client;
use think\facade\Route;
use think\facade\Request;

// Route::any('/', function () {
//     return '超卓定制 ' . 'time: ' . date('Y-m-d H:i:s', time());
// });
Route::any('/', function () {
    if (Request::instance()->server('SERVER_PORT') == 8003) {
        return redirect('dist');
    }
    return success(date('Y-m-d H:i:s', time()));
});
/* 系统时间校准 */
Route::any('/sysTime', function () {
    $aes_data = date('Y-m-d H:i:s', time());
    return success($aes_data);
});
Route::any('/test', function () {
    return phpinfo();
});
/* 无中间件 */
Route::any('/web/getYmToken', 'WebController/getYmToken');
Route::any('/wx/getYmToken', 'WebController/getYmToken');
Route::post('/web/login', 'WebController/login');
Route::post('/wx/login', 'WxController/login');//登录
Route::post('/web/getYsAccessToken', 'WebController/getYsAccessToken');


/* 接口 */
Route::group('web', function () {
    /* 用户 */
    Route::any('addEquiment', 'WebController/addEquiment'); //添加修改设备
    Route::any('addProject', 'WebController/addProject'); //添加修改项目
    Route::any('projectList', 'WebController/projectList'); //项目列表
    Route::any('equimentProjectList', 'WebController/equimentProjectList'); //项目列表
    Route::any('equimentList', 'WebController/equimentList'); //设备列表
    Route::any('reEquiment', 'WebController/reEquiment'); //设备列表
    Route::any('equimentInfo', 'WebController/equimentInfo'); //设备信息
    Route::any('towerCycleList', 'WebController/towerCycleList'); //塔机工作循环
    Route::any('uploadFaceFile', 'WebController/uploadFaceFile'); //塔机工作循环
    Route::any('addFace', 'WebController/addFace'); //添加人脸
    Route::any('reFace', 'WebController/reFace'); //删除人脸
    Route::any('reProject', 'WebController/reProject'); //删除项目
    Route::any('reInspect', 'WebController/reInspect'); //删除检修
    Route::any('reAiVideo', 'WebController/reAiVideo'); //删除AI
    Route::any('reAlarm', 'WebController/reAlarm'); //删除报警
    Route::any('faceRecordList', 'WebController/faceRecordList'); //人脸记录
    Route::any('faceList', 'WebController/faceList'); //人脸列表
    Route::any('inspectWeektable', 'WebController/inspectWeektable'); //周检表格
    Route::any('inspectMonthtable', 'WebController/inspectMonthtable'); //月检表格
    Route::any('inspectRepairtable', 'WebController/inspectRepairtable'); //检修表格
    Route::any('inspectServicetable', 'WebController/inspectServicetable'); //报修表格
    Route::any('inspectList', 'WebController/inspectList'); //检查表
    Route::any('aiVideoList', 'WebController/aiVideoList'); //AI视频
    Route::any('alarmList', 'WebController/alarmList'); //AI视频
    Route::any('downloadAiVideo', 'WebController/downloadAiVideo'); //请求下载AI视频
    Route::any('downloadAlarmAiVideo', 'WebController/downloadAlarmAiVideo'); //请求下载AI视频
    Route::any('realtimeList', 'WebController/realtimeList'); //实时数据
    Route::any('inspectServiceRemind', 'WebController/inspectServiceRemind'); //报修提醒
    Route::any('dealwithServicetable', 'WebController/dealwithServicetable'); //报修提醒
    Route::any('exportTowercycle', 'WebController/exportTowercycle'); //导出工作循环
    Route::any('exportAiVideo', 'WebController/exportAiVideo'); //导出AI视频
    Route::any('exportAlarm', 'WebController/exportAlarm'); //导出设备报警
    Route::any('exportCSV', 'WebController/exportCSV');
    Route::any('gb28181Config', 'WebController/gb28181Config');//摄像头国标设置
});
Route::group('wx', function () {
    Route::any('projectList', 'WxController/projectList');
    Route::any('equimentList', 'WxController/equimentList');
    Route::any('equimentInfo', 'WxController/equimentInfo');
    Route::any('equimentRealtimeVideo', 'WxController/equimentRealtimeVideo');
    Route::any('faceList', 'WxController/faceList');
    Route::any('addInspectWeektable', 'WxController/addInspectWeektable');
    Route::any('addInspectMonthtable', 'WxController/addInspectMonthtable');
    Route::any('addInspectRepairtable', 'WxController/addInspectRepairtable');
    Route::any('addInspectServicetable', 'WxController/addInspectServicetable');
    Route::any('towerCycleList', 'WxController/towerCycleList');
    Route::any('userInfo', 'WxController/userInfo');
    Route::any('uploadFile', 'WxController/uploadFile');//上传头像
    Route::any('aiVideoList', 'WxController/aiVideoList');//AI视频记录
    Route::any('alarmList', 'WxController/alarmList');//AI视频记录
    Route::any('downloadAiVideo', 'WxController/downloadAiVideo');//请求AI视频记录
});
Route::group('eq', function () {
    Route::any('addAiVideoUrl', 'EqController/addAiVideoUrl');//请求AI视频记录地址
    Route::any('addAiVideo', 'EqController/addAiVideo');//请求AI视频记录
    Route::any('getQnToken', 'EqController/getQnToken');//获取七牛上传凭证
    Route::any('createData', 'EqController/createData');//添加实时数据
    Route::any('towerCraneWorkdata', 'EqController/towerCraneWorkdata');//添加塔机工作循环数据
    Route::any('createAlarmData', 'EqController/createAlarmData');//添加实时数据
    Route::any('getRangeUrl', 'EqController/getRangeUrl');//安卓远程软件下载地址
    Route::any('getSoftwareUrl', 'EqController/getSoftwareUrl');//系统版本
    Route::any('verificationEquipment', 'EqController/verificationEquipment');//设备校验
    Route::any('getStaffInfo', 'EqController/getStaffInfo');//获取人员信息
    Route::any('addAttendance', 'EqController/addAttendance');//添加考勤信息
    Route::any('uploadFaceImg', 'EqController/uploadFaceImg');//上传人脸照片
    Route::any('uploadFace', 'EqController/uploadFace');//上传人脸照片
    Route::any('gb28181Config', 'EqController/gb28181Config');//摄像头国标设置
});
